import request from '@/utils/request'

// 获取月卡列表
/**
 *
 * @param {*} params
 * @returns
 */
export const getCardListAPI = params => {
  return request({
    url: 'parking/card/list',
    params
  })
}

// 新增月卡
/**
 *
 * @param {*} data
 * @returns
 */
export const createCardAPI = data => {
  return request({
    url: 'parking/card',
    method: 'post',
    data
  })
}

/**
 *  获取月卡详情
 * @param {*} id
 * @returns
 */
export const getCardDetailAPI = id => {
  return request({
    url: `parking/card/detail/${id}`
  })
}

/**
 * 编辑月卡
 * @param {*} data
 * @returns
 */
export const updateCardAPI = data => {
  return request({
    url: 'parking/card/edit',
    method: 'put',
    data
  })
}

export const delCard = ids => {
  return request({
    url: `parking/card/${ids}`,
    method: 'delete'
  })
}
